@include('admin/_include/header')

<link rel="stylesheet" href="{{asset('css/login.css')}}">

<body style="height:100%;">

<div class="boxer">
    <h2 class="logo"><img alt="" src="{{asset('images/logo.png')}}" /></h2>
    <div class="box1">
        <div class="middle1">
            <div class="middle_left">
                <img alt="" src="{{asset('images/login-bg.jpg')}}">
            </div>
            <div class="middle_right">
                <div class="mr_box">
                    <h2>欢迎登录</h2>
                    <form>
                        <div class="form-group">
                            <span class="iconfont icon-Profile icon_p"></span>
                            <input type="text" name="name" class="form-control icon-user" id="email" placeholder="请输入您的账号">
                        </div>
                        <div class="form-group mar_b">
                            <span class="iconfont icon-Unlock icon_p"></span>
                            <input type="password" name="password" class="form-control icon-pass" id="pwd" placeholder="请输入您的密码">
                        </div>

                        <div class="form-check font-s">
                            <div class="custom-control custom-checkbox small">
                                <input type="checkbox" name="remember" class="custom-control-input" id="customCheck">
                                <label class="custom-control-label" for="customCheck">记住密码</label>
                            </div>
                        </div>
                        <div class="f_pass" style="display: none">
                            <div class="f_pass_n">
                                <i class="fl"><img alt="" src="{{asset('images/sq.png')}}"></i>
                                <p>账号或者密码不正确,请重新输入!</p>
                            </div>
                        </div>
                        <button type="button" class="login">登录</button>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</body>

<script>
    layui.use(['form'], function () {

        $('.login').on('click', function () {
            $.ajax({
                url: "{{url('auth/login')}}",
                type: "post",
                dataType: "json",
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                },
                beforeSend: function () {
                    ajaxLoad = loading();
                },
                data: $('form').serializeArray(),
                success: function (e) {
                    layer.closeAll();
                    if (e.status == SUCCESS) {
                        reload()
                    } else {

                        $('.f_pass').fadeIn();
                    }

                }
            });
        })
    });



</script>

@include('admin/_include/footer')